﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using Common;

namespace BL_WServices
{
    /// <summary>
    /// This is the Implementation of MenusService which is bound by a ServiceContract
    /// </summary>
    [ServiceContract]
    public interface IMenusService
    {
        /// <summary>
        /// Return the Menus depending on the roleID of the logged in user
        /// Used for guest
        /// </summary>
        /// <param name="roleId">Of type int. The RoleID of the user is passed here 
        /// so that the correct menus are fetched for the user</param>
        /// <returns>Returns the MainMenus depending on the roleID of the user</returns>
        [OperationContract]
        IQueryable<Menu> GetMainMenus(int roleId);

        /// <summary>
        /// Gets the SubMenus from the Database depending on the roleID.
        /// Used for Guest
        /// </summary>
        /// <param name="roleId">Of type int. The roleID of the user is passed here so that the correct menus
        /// are loaded for the user</param>
        /// <returns>Returns the SubMenus of a particular Menu depending on the roleID. </returns>
        [OperationContract]
        IQueryable<Menu> GetSubMenus(int roleId);

        /// <summary>
        /// Gets the Main Menu items from the Database depending on the username
        /// </summary>
        /// <param name="username">Of type string. The username is passed here so that the menus are fetched depending
        /// on the username and role of that username.</param>
        /// <returns>Returns the Main Menu items depending on the username.</returns>
        [OperationContract]
        IQueryable<Menu> GetMainMenusByUsername(string username);

        /// <summary>
        /// Gets the SubMenu items from the Database depending on the username and parentID of the menu.
        /// Used for logged in users.
        /// </summary>
        /// <param name="username">Of type string. Username is passed here so that the submenus are fetched depending 
        /// on the username and role of that username.</param>
        /// <returns>Returns the Sub menus for the Username</returns>
        [OperationContract]
        IQueryable<Menu> GetSubMenusByUsername(string username); 
    }
}
